<template>
  <div class="count">
    <h1>Count</h1>
    <h2>当前的num值是:{{ $store.state.Count.num }}</h2>
    <h2>当前的num值是:{{num }}</h2>
    <h2>当前的doubleNum值是:{{doubleNum }}</h2>
    <h3>下边的组件电影总共有{{movieList.length}}</h3>
    <div>
      <button @click="increment">累加num</button>
      <button @click="incrementN({ n: 2 })">累加N--num </button>
      <button @click="incrementWait">延迟1s累加</button>
      <button @click="incrementNWait({ n: 2 })">延迟1s累加n</button>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapActions ,mapMutations,mapActions, mapState, mapGetters} from "vuex";
export default {
  name: "Count",
  mounted() {
    console.log(this);
  },
  methods: {
    ...mapMutations("Count",["increment", "incrementN"]),
    ...mapActions("Count",["incrementNwait", "incrementNWait"]),
  },
  computed:{
    ...mapState("Count",["num"]),
    ...mapGetters("Count",["doubleNum"]),
    ...mapState("Movie",["movieList"])
  }
};
</script>

<style scoped>
.count {
  background: pink;
}
</style>
